package NetModel.network;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;


import java.io.IOException;
import java.util.Map;

/**
 * Created by Administrator on 2016/10/26.
 * 网络操作接口
 */
public interface INetOperation {

    Object get(@NonNull String url,
               @Nullable Map<String, String> heads,
               @Nullable Map<String, String> params,
               @Nullable Object tag) throws IOException, ClientException;

    Object delete(@NonNull String url, @Nullable Map<String, String> heads, @Nullable Map<String, String> params, @Nullable Object tag) throws IOException, ClientException;

    Object post(@NonNull String url,
                @Nullable Map<String, String> heads,
                @NonNull Map<String, String> params,
                @Nullable Object tag) throws IOException, ClientException;

    Object postString(@NonNull String url,
                      @Nullable Map<String, String> heads,
                      @NonNull String context,
                      @Nullable Object tag) throws IOException, ClientException;


    Object postString(@NonNull String url, @Nullable Map<String, String> heads, @NonNull String context, @Nullable Object tag,
                      @NonNull Integer connectTimeout, @NonNull Integer readTimeout, @NonNull Integer writeTimeout) throws IOException, ClientException;

    Object put(@NonNull String url, @Nullable Map<String, String> heads, @NonNull String context, @Nullable Object tag) throws IOException, ClientException;

    Object postFile(@NonNull String url,
                    @Nullable Map<String, String> heads,
                    @NonNull String filePath,
                    @Nullable Object tag) throws IOException, ClientException;

    Object putFile(@NonNull String url,
                   @Nullable Map<String, String> heads,
                   @NonNull String filePath,
                   @Nullable Object tag) throws IOException, ClientException;


    Object putByte(@NonNull String url,
                   @Nullable Map<String, String> heads,
                   @NonNull byte[] bytes,
                   @Nullable Integer offset,
                   @Nullable Integer byteCount,
                   @Nullable Object tag) throws IOException, ClientException;

}
